package com.controller;

import com.domain.Employee;
import com.domain.Whour;
import com.server.TeamService;
import com.server.EmployeeService;
import com.server.WhourService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
@RequestMapping(value = "/whour")
public class WhourController {

    @Resource(name = "employeeService")
    private EmployeeService employeeService;
    @Resource(name = "teamService")
    private TeamService teamService;

    @Resource(name = "whourService")
    private WhourService whourService;


    //通用页面跳转控制器
    @RequestMapping(value="/{formName}")
    public String f(@PathVariable String formName){
        return formName;
    }

    @RequestMapping(value="/03main")
    public String main03(){
        return "03main";
    }

    @RequestMapping(value="/06whour")
    public String whour06(){
        return "06统计报表";
    }

    @RequestMapping(value="/07whour")
    public String whour07(){
        return "07统计报表";
    }


    @RequestMapping(value = "/showWhour")
    public String showWhour(@Param("number")String number,Model model) {
        List<Whour> whourList = whourService.showWhour();
        System.out.println("----------------------"+number);
        model.addAttribute("whourList", whourList);
        return  "whour";
    }
}
